<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">
        
        <ui:define name="title">
            Protocolo
        </ui:define>

        <ui:define name="breadcrumb">
            <div class="breadcrumb_divider"></div>
            <a href="pesquisarProtocolo.xhtml">Protocolo</a>
            <div class="breadcrumb_divider"></div>
            <a class="current">Detalhes</a>
        </ui:define>

        <ui:define name="sidebar">
            <h3>Protocolo</h3>
            <ul class="toggle">
                <li class="icn_new_article"><a href="criarProtocolo.xhtml">Cadastrar</a></li>
                <li class="icn_search"><a href="pesquisarProtocolo.xhtml">Pesquisar</a></li>
            </ul>
            <h3>Ações</h3>
            <ul class="toggle">
                <li class="icn_categories"><a href="selarProtocolo.xhtml?protocoloId=#{ managerPesquisarProtocolo.protocoloVisualizar.id }">Selar</a></li>
                <li class="icn_categories"><a href="criarProtocolo.xhtml?protocoloId=#{ managerPesquisarProtocolo.protocoloVisualizar.id }">Editar</a></li>
            </ul>
        </ui:define>        
        
        <ui:define name="content">
            
            <p:panel styleClass="column12">
                
                <div class="row">
                    <div class="column2 bold">
                        <p:outputLabel value="Código:" />
                    </div>                    
                    <div class="column2 text">
                        <p:outputLabel value="#{ managerPesquisarProtocolo.protocoloVisualizar.id }" />
                    </div>
                </div>                
                
                <div class="row">
                    <div class="column2 bold">
                        <p:outputLabel value="Tipo:" />
                    </div>                    
                    <div class="column2 text">
                        <p:outputLabel value="#{ managerPesquisarProtocolo.protocoloVisualizar.tipoProtocolo.nome }" />
                    </div>
                </div>

                <div class="row">
                    <div class="column2 bold">
                        <p:outputLabel value="Cliente:" />
                    </div>
                    <div class="column9 text">
                        <p:outputLabel value="#{ managerPesquisarProtocolo.protocoloVisualizar.cliente.nome }" />
                    </div>                    
                </div>

                <p:dataTable id="protocoloItensDataTable" styleClass="column12" var="item" value="#{ managerPesquisarProtocolo.protocoloItens }"
                        emptyMessage="Nenhum serviço adicionado">
                    <f:facet name="header">Serviços</f:facet>

                    <p:column headerText="Ato" width="40%">
                        #{ item.atoItem.descricao }
                    </p:column>
                    <p:column headerText="Prazo (Dias)" width="15%">
                        #{ item.atoItem.prazo }
                    </p:column>
                    <p:column headerText="Cartório" width="15%">
                        <h:outputLabel value="#{ item.valorCartorio }">
                            <f:convertNumber type="currency" locale="pt-BR" />
                        </h:outputLabel>
                    </p:column>
                    <p:column headerText="FERMOJUPI" width="15%">
                        <h:outputLabel value="#{ item.valorFermojupi }">
                            <f:convertNumber type="currency" locale="pt-BR" />
                        </h:outputLabel>
                    </p:column>
                    <p:column headerText="Total" width="15%">
                        <h:outputLabel value="#{ item.valor }">
                            <f:convertNumber type="currency" locale="pt-BR" />
                        </h:outputLabel>
                    </p:column>
                </p:dataTable>

                <p:panel styleClass="column6" header="Total">
                    <div class="row">
                        <div class="column5 bold">
                            <p:outputLabel value="Valor do Cartório:" />
                        </div>
                        <div class="column5 text">
                            <p:outputLabel value="#{ managerCriarProtocolo.protocolo.valorTotalCartorio  }">
                                <f:convertNumber type="currency" locale="pt-BR" />
                            </p:outputLabel>
                        </div>
                    </div>
                    <div class="row">
                        <div class="column5 bold">
                            <p:outputLabel value="Valor do FERMOJUPI:" />
                        </div>
                        <div class="column5 text">
                            <p:outputLabel value="#{ managerCriarProtocolo.protocolo.valorTotalFermojupi }">
                                <f:convertNumber type="currency" locale="pt-BR" />
                            </p:outputLabel>
                        </div>
                    </div>
                    <div class="row">
                        <div class="column5 bold">
                            <p:outputLabel value="Valor Total:" />
                        </div>
                        <div class="column5 text">
                            <p:outputLabel value="#{ managerCriarProtocolo.valorTotalProtocolo }">
                                <f:convertNumber type="currency" locale="pt-BR" />
                            </p:outputLabel>                            
                        </div>
                    </div>
                </p:panel>
                
                <p:panel id="pagamentoProtocoloPanel" styleClass="column6" header="Pagamento">
                    <div class="row">
                        <div class="column5 bold">
                            <p:outputLabel value="Forma de pagamento:" />
                        </div>
                        <div class="column5 text">
                            <p:outputLabel value="#{ managerCriarProtocolo.protocolo.formaPagamento.nome }" />
                        </div>                        
                    </div>
                </p:panel>
                
            </p:panel>

            <div class="command">
                <p:button value="Voltar" icon="ui-icon-arrowreturn-1-w" href="pesquisarProtocolo.xhtml" />
            </div>

        </ui:define>
    </ui:composition>

</html>